<?php
namespace app\admin\model;

use think\Model;

class Order extends Model
{
    public static function orderList($where)
    {
        $list = Order::alias('o')
            ->field('o.*,os.order_status')
            ->join('order_status os','o.status=os.status_id')
            ->where($where)
            ->paginate(
                [
                    'list_rows'=>5,
                ]
            );
        return $list;
    }
    public static function orderInfo($id)
    {
        $list = Order::alias('o')
            ->where('o.id','=',$id)
            ->field('o.*,os.order_status,c.name as sheng,cc.name as city,ccc.name as quyu,u.nickname')
            ->join('order_status os','o.status=os.status_id')
            ->join('china_city c','c.id=o.asheng')
            ->join('china_city cc','cc.id=o.acity')
            ->join('china_city ccc','ccc.id=o.aquyu')
            ->join('user u','u.id=o.uid')
            ->find();
        return $list;
    }
}